package com.itcast.plane.modoule.indent.controller;

import com.itcast.plane.modoule.indent.dto.IndentCreatDTO;
import com.itcast.plane.modoule.indent.dto.IndentLookDTO;
import com.itcast.plane.modoule.indent.dto.IndentLookPersonDTO;
import com.itcast.plane.modoule.indent.dto.IndentPayDTO;
import com.itcast.plane.modoule.indent.service.IndentService;
import com.itcast.plane.util.JsonResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/indent")
public class IndentController {

    @Resource
    private IndentService indentService;

    @PostMapping("/order")
    public JsonResult order(@RequestBody IndentCreatDTO creatDTO){
        return indentService.order(creatDTO);
    }

    @PutMapping("/pay")
    public JsonResult pay(@RequestBody IndentPayDTO dto){
        return indentService.pay(dto);
    }

    @PostMapping("/getpage")
    public JsonResult getPage(@RequestBody IndentLookDTO lookDTO){
        return indentService.getPage(lookDTO);
    }

    @PostMapping("/getperson")
    public JsonResult getPerson(@RequestBody IndentLookPersonDTO lookPersonDTO){
        return indentService.getPerson(lookPersonDTO);
    }

}
